package aps

import glory.xxd.Utils

/**
 * 执行结束作业
 */
class EndProcessController {

    def commentService

    def index() {

        def EqpId = params.EqpId ?: ''
        def LotId = params.LotId ?: ''
        def DoneQty = params.DoneQty ?: ''
        def Remark =params.Remark?:''
//        print Remark
        def body = CommentParams.newInstance()
        body.setEqpId(EqpId)
        body.setDoneQty(DoneQty)
        body.setLotId(LotId)


        if (Remark != null && Remark != "") {
            body.setRemark(Remark)
//            body.setCarrier(Carrier)
        }
        String logUUID = Utils.getUUID();
        Header header = Header.newInstance()
        header.setMESSAGENAME("EndProcess");
        header.setTRANSACTIONID(logUUID);
        header.setUSERNAME("EAP")

        def json = commentService.getJsonByObjectForTopic2Queue(logUUID, header, body)
//        print json
        render json//返回1,标识分发成功
    }
}

